<%@ page language="java" contentType="text/html; charset=utf8"
         pageEncoding="utf8" %>

<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <link rel="stylesheet" href="style.css" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Регистрация</title>



      <script type="text/javascript" src="<c:out value="${root}"/>/js/jquery.js"></script>
<script type="text/javascript" src="<c:out value="${root}"/>/js/jquery.validation_form.js"></script>
    <script type="text/javascript" src="<c:out value="${root}"/>/js/valid.js"></script>


</head>
<body background="<c:out value="${root}"/>/img/bg.png" style="background-repeat:repeat; margin-top:0 ;">

<table align="center"  border="1" cellspacing="0">

      <%@include file="/WEB-INF/inc/header.jsp" %>
    <tr bgcolor="#ffffff" >
        <td>

            Регистрация нового студента. Заполните поля


            <form method="POST" name="validation_form" class="validation_form"
                  action="add"

                  commandName="person"
                    >

                <table border="0" align="center">
                               <tr>

                                  <td>
                                      <table border="0" align="center">


                                                              <tr>
                                                                <td align="right">Фамилия</td>
                                                            </tr>
                                                            <tr>

                                                                <td><input class="text important" type="text" name="fname" value ="<c:out value="${info.fname}"/>"/></td>
                                                            </tr>
                                                            <tr>
                                                                 <td align="right">Имя</td>
                                                            </tr>
                                                            <tr>

                                                                <td><input class="text important" type="text" name="sname"value ="<c:out value="${info.sname}"/>"/></td>
                                                            </tr>
                                                             <tr>
                                                             <td align="right">Отчество</td>
                                                            </tr>
                                                            <tr>

                                                                <td><input class="text important" type="text" name="tname"value ="<c:out value="${info.tname}"/>"/></td>
                                                            </tr>
                                                     </table>

                                  </td>

                                          <td>
                                              <table border="0" align="center">




                             <tr>
                                  <td align="right">Группа</td>
                             </tr>
                              <tr>
                                     <td align="right">
                                         <select name="grpid">
                                             <c:forEach items="${group}" var="gr">

                                                 <option value = "<c:out value="${gr[0]}"/>"><c:out value="${gr[1]}"/></option>

                                             </c:forEach>

                                         </select>
                                     </td>
                                 </tr>
                                        <tr>
                                  <td align="right">E-mail</td>
                                 </tr>
                                 <tr>


                                     <td><input class="text email important" type="text" name="email"/></td>
                                 </tr>
                                         <tr>
                                     <td align="right">Пароль(От 5 символов)</td>
                                 </tr>
                                 <tr>

                                     <td><input class = "text password1 important" type="password" name="password"/></td>
                                 </tr>
                                  <tr>
                                    <td align="right">Подтвердите пароль</td>
                                 </tr>
                                 <tr>

                                     <td><input class = "text password2 important" type="password" name="password2"/></td>
                                 </tr>



                                 <tr>
                                     <td colspan="2" align="right">
                                         <input class = "submit" type="submit" value="Добавить"/>
                                         <input type="reset" value="Сбросить"/></td>
                                 </tr>

                             </table>


                         </form>


            <c:if test="${not empty param.error}">
                <font color="red">
                    Попытка логина не удалась. Попробуйте еще раз.<br/><br/>
                    Причина: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
                </font>
            </c:if>
            <br>


        </td>
    </tr>

    <tr>
        <td colspan="11">
            <%@include file="/WEB-INF/inc/footer.jsp" %>
        </td>
    </tr>

</table>


</body>
</html>